package jk.spider.core.event.impl;

import java.util.Date;

import jk.spider.core.SpiderController;
import jk.spider.core.event.CoreEventVisitor;
import jk.spider.model.Resource;

public class URLSpideredErrorEvent extends BaseCoreEventImpl {
	protected int httpStatus;
	protected String dTime;
	public URLSpideredErrorEvent(SpiderController controller, Resource resource, int httpStatus) {
		super(controller, resource);
		this.httpStatus = httpStatus;
	}

	public void accept(Resource resource, CoreEventVisitor visitor) {
		visitor.visit(resource, this);
	}
	
	public int getHttpStatus() {
		return this.httpStatus;
	}
	
	@SuppressWarnings("deprecation")
	public String getDTime() {
		return new Date().toLocaleString();
	}
	
	public String getUrl() {
		return resource.getUrl();
	}
}
